<?php

	class SaveFileCommand implements ICommand
	{
		public function execute($event)
		{
			$filepath = $event->data["filepath"];
			$filecontent = $event->data["filecontent"];
			
			if (file_exists(ROOT.$filepath))
			{		
				file_put_contents(ROOT.$filepath,$filecontent);
				return "success";
			}
			else
			{
				return "The file doesnt exists!";
			}
		}
	}